#include "mainwindow.h"
#include <QTextEdit>
#include <QDockWidget>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    setWindowTitle(tr("DockWindow"));
    QTextEdit *te=new QTextEdit(this);
    te->setText(tr("Mainwindow"));
    te->setAlignment(Qt::AlignCenter);
    setCentralWidget(te);

    QDockWidget *dock=new QDockWidget(tr("DockWindow1"),this);
    dock->setFeatures(QDockWidget::DockWidgetMovable);
    dock->setAllowedAreas(Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea);

    QTextEdit *tel=new QTextEdit();
    tel->setText(tr("Window1, The dock widget can be moved between docks by the user"  ""));
    dock->setWidget(tel);
    addDockWidget(Qt::RightDockWidgetArea,dock);

    dock=new QDockWidget(tr("DockWindow2"),this);
    dock->setFeatures(QDockWidget::DockWidgetClosable|QDockWidget::DockWidgetFloatable);
    QTextEdit *te2=new QTextEdit();
    te2->setText(tr("Window2, the dock widget can be detched from the main window",
                    "andfloated as an independent window, and can  be closed "));
    dock->setWidget(te2);
    addDockWidget(Qt::RightDockWidgetArea,dock);

    dock=new QDockWidget(tr("DockWindow3"),this);
    dock->setFeatures(QDockWidget::AllDockWidgetFeatures);
    QTextEdit *te3=new QTextEdit();
    te3->setText(tr("Window3, The dock widget can be closed, moved, and floated"));
    dock->setWidget(te3);
    addDockWidget(Qt::RightDockWidgetArea,dock);

}

MainWindow::~MainWindow()
{

}
